Left Termination of the query pattern shanoi_in_5(g, g, g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

shanoi(s(0), A, B, C, .(mv(A, C), [])).
shanoi(s(s(X)), A, B, C, M) :- ','(eq(N1, s(X)), ','(shanoi(N1, A, C, B, M1), ','(shanoi(N1, B, A, C, M2), ','(append(M1, .(mv(A, C), []), T), append(T, M2, M))))).
append([], L, L).
append(.(H, L), L1, .(H, R)) :- append(L, L1, R).
eq(X, X).

Queries:

shanoi(g,g,g,g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
shanoi_in: (b,b,b,b,f)
append_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → EQ_IN_AG(N1, s(X))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_GGGGA(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_GGGGA(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → APPEND_IN_GGA(M1, .(mv(A, C), []), T)
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → U6_GGA(H, L, L1, R, append_in_gga(L, L1, R))
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_GGGGA(X, A, B, C, M, append_in_gga(T, M2, M))
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → APPEND_IN_GGA(T, M2, M)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
U3_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGGGA(x2, x4, x6, x7)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x5)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x2, x3, x4, x6)
U5_GGGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGGA(x6)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U4_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GGGGA(x6, x7)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x2, x3, x4, x6, x7)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → EQ_IN_AG(N1, s(X))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_GGGGA(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_GGGGA(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → APPEND_IN_GGA(M1, .(mv(A, C), []), T)
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → U6_GGA(H, L, L1, R, append_in_gga(L, L1, R))
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_GGGGA(X, A, B, C, M, append_in_gga(T, M2, M))
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → APPEND_IN_GGA(T, M2, M)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
U3_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGGGA(x2, x4, x6, x7)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x5)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x2, x3, x4, x6)
U5_GGGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGGA(x6)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U4_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GGGGA(x6, x7)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x2, x3, x4, x6, x7)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 7 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN_GGA(.(H, L), L1) → APPEND_IN_GGA(L, L1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x2, x3, x4, x6)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x2, x3, x4, x6, x7)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ Rewriting

Q DP problem:
The TRS P consists of the following rules:

U1_GGGGA(A, B, C, eq_out_ag(N1)) → SHANOI_IN_GGGGA(N1, A, C, B)
U2_GGGGA(A, B, C, N1, shanoi_out_gggga(M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
U1_GGGGA(A, B, C, eq_out_ag(N1)) → U2_GGGGA(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_in_ag(s(X)))

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(.(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X)
U1_gggga(A, B, C, eq_out_ag(N1)) → U2_gggga(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(A, B, C, N1, shanoi_out_gggga(M1)) → U3_gggga(A, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(A, C, M1, shanoi_out_gggga(M2)) → U4_gggga(M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L), L1) → U6_gga(H, append_in_gga(L, L1))
U6_gga(H, append_out_gga(R)) → append_out_gga(.(H, R))
U4_gggga(M2, append_out_gga(T)) → U5_gggga(append_in_gga(T, M2))
U5_gggga(append_out_gga(M)) → shanoi_out_gggga(M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3)
U2_gggga(x0, x1, x2, x3, x4)
U3_gggga(x0, x1, x2, x3)
append_in_gga(x0, x1)
U6_gga(x0, x1)
U4_gggga(x0, x1)
U5_gggga(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_in_ag(s(X))) at position [3] we obtained the following new rules:

SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_out_ag(s(X)))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U1_GGGGA(A, B, C, eq_out_ag(N1)) → SHANOI_IN_GGGGA(N1, A, C, B)
SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_out_ag(s(X)))
U2_GGGGA(A, B, C, N1, shanoi_out_gggga(M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
U1_GGGGA(A, B, C, eq_out_ag(N1)) → U2_GGGGA(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(.(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X)
U1_gggga(A, B, C, eq_out_ag(N1)) → U2_gggga(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(A, B, C, N1, shanoi_out_gggga(M1)) → U3_gggga(A, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(A, C, M1, shanoi_out_gggga(M2)) → U4_gggga(M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L), L1) → U6_gga(H, append_in_gga(L, L1))
U6_gga(H, append_out_gga(R)) → append_out_gga(.(H, R))
U4_gggga(M2, append_out_gga(T)) → U5_gggga(append_in_gga(T, M2))
U5_gggga(append_out_gga(M)) → shanoi_out_gggga(M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3)
U2_gggga(x0, x1, x2, x3, x4)
U3_gggga(x0, x1, x2, x3)
append_in_gga(x0, x1)
U6_gga(x0, x1)
U4_gggga(x0, x1)
U5_gggga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_out_ag(s(X)))
The remaining pairs can at least be oriented weakly.

U1_GGGGA(A, B, C, eq_out_ag(N1)) → SHANOI_IN_GGGGA(N1, A, C, B)
U2_GGGGA(A, B, C, N1, shanoi_out_gggga(M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
U1_GGGGA(A, B, C, eq_out_ag(N1)) → U2_GGGGA(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 0   
POL(0) = 0   
POL(SHANOI_IN_GGGGA(x1, x2, x3, x4)) = x1   
POL(U1_GGGGA(x1, x2, x3, x4)) = x4   
POL(U1_gggga(x1, x2, x3, x4)) = 0   
POL(U2_GGGGA(x1, x2, x3, x4, x5)) = x4   
POL(U2_gggga(x1, x2, x3, x4, x5)) = 0   
POL(U3_gggga(x1, x2, x3, x4)) = 0   
POL(U4_gggga(x1, x2)) = 0   
POL(U5_gggga(x1)) = 0   
POL(U6_gga(x1, x2)) = 0   
POL([]) = 0   
POL(append_in_gga(x1, x2)) = 0   
POL(append_out_gga(x1)) = 0   
POL(eq_in_ag(x1)) = 0   
POL(eq_out_ag(x1)) = x1   
POL(mv(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   
POL(shanoi_in_gggga(x1, x2, x3, x4)) = 0   
POL(shanoi_out_gggga(x1)) = 0   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U1_GGGGA(A, B, C, eq_out_ag(N1)) → SHANOI_IN_GGGGA(N1, A, C, B)
U2_GGGGA(A, B, C, N1, shanoi_out_gggga(M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
U1_GGGGA(A, B, C, eq_out_ag(N1)) → U2_GGGGA(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(.(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X)
U1_gggga(A, B, C, eq_out_ag(N1)) → U2_gggga(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(A, B, C, N1, shanoi_out_gggga(M1)) → U3_gggga(A, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(A, C, M1, shanoi_out_gggga(M2)) → U4_gggga(M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L), L1) → U6_gga(H, append_in_gga(L, L1))
U6_gga(H, append_out_gga(R)) → append_out_gga(.(H, R))
U4_gggga(M2, append_out_gga(T)) → U5_gggga(append_in_gga(T, M2))
U5_gggga(append_out_gga(M)) → shanoi_out_gggga(M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3)
U2_gggga(x0, x1, x2, x3, x4)
U3_gggga(x0, x1, x2, x3)
append_in_gga(x0, x1)
U6_gga(x0, x1)
U4_gggga(x0, x1)
U5_gggga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.